<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>收藏商品</title>
		<meta name="keywords" content="知果汇" />
		<meta name="description" content="知果汇" />
		<link rel="SHORTCUT ICON" href="_IMG_/favicon.ico" />
		<link rel="stylesheet" type="text/css" href="_CSS_/common.css" />
		<style type="text/css">
			html,body{width: 550px;height: 270px;margin: 0;padding: 0;}
			p{margin: 0;}
			.fl{float: left;}
			.content{padding: 20px;width: 520px;}
			.content p{font-size: 17px;}
			.links{color: #3377C1;text-decoration:none;}
			.hotCollection{margin-top: 20px;}
			.hotCollection h4{font-size: 14px;margin-bottom: 10px;}
			.icon-refresh01{margin-top: 3px;margin-right: 10px;}
			.con{overflow: hidden;}
			.conItem{float: left;width: 120px;border: 1px solid #E5E5E5;margin-right: 8px;}
			.conItem img{width: 120px;height: 120px;}
			.title{padding: 0 20px;font-size: 14px;height: 34px;line-height: 34px;}
			.productName{text-decoration:none;color:#333;}
			.icon-refresh01{
			            cursor: pointer;

			}
		</style>
	</head>
	<body>
		<div class="content">
			<p><span class="icons icon-success"></span>商品已收藏成功，去<a class="links" href="javascript:;">收藏的宝贝</a>看看吧！</p>
			<div class="hotCollection">
				<h4>热门收藏<span class="icons icon-refresh01 fr"></span></h4>
				<div class="con">

				</div>
			</div>
		</div>
	</body>
	<script src="_JS_/jquery-1.8.3.min.js"></script>
	<script src="_JS_/jquery.base64.js"></script>
	<script src="_JS_/jquery.cookie.js"></script>
	<script src="_JS_/common.js"></script>
	<script src="_P_/layer/layer.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$('.links').on('click',function(){
				window.open("/index.php/index/person/collect_products", "", "", "");
			})
			get_rand('w.collect desc');
		});
		$(".icon-refresh01").on('click',function(){
			get_rand('rand(),w.collect desc');
		})
		function get_rand(order){
			$.ajax({
				type: "get",
				url: "/index.php/api/service/rand_goods",
				data: {'number': 4,'order': order},
				dataType: 'jsonp',
				success: function (msg) {
					if(msg.code==200){
						if(msg.data.length>0){
							var html='';
							for(var i=0;i<msg.data.length;i++){
								var name = cut(msg.data[i].goods_name,4);
								html+='<div class="conItem" num="'+msg.data[i].id+'">';
								html+=	'<img src="/Images/serviceGoods/'+msg.data[i].pic+'"/><p class="title text_overflow" title="'+ msg.data[i].goods_name +'">'+name+'</p></div>';
							}
						}
						$('.con').html(html);
						$('.conItem').on('click',function(){
							var id=$(this).attr('num');
							window.open("/index.php/index/service/service_details.html?id="+id);
						})
					}
					if(msg.code==1000){
						layer.msg('未知错误！', {icon: 51});
					}
				}
			});
		}
	</script>
</html>
